package com.smart.enums;

public enum BatchSendTaskEnum {
    DRAFT(0,"草稿"),
    SUBMIT(1,"未开始"),
    RUNNING(2,"进行中"),
    FINISHED(3,"已结束"),
    REVOKE(4,"已撤销");


    private int code;
    private String name;
    BatchSendTaskEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    public static String getName(int code){
        for (BatchSendTaskEnum obj : BatchSendTaskEnum.values()) {
            if(obj.getCode() == code){
                return obj.getName();
            }
        }
        return "";
    }

    public String getName() {
        return name;
    }

    public int getCode() {
        return code;
    }
}
